﻿@using thousandclear.Data
@model List<T_Reward>
@{
    ViewBag.Title = "打赏管理";
    Layout = "~/Areas/Admin/Views/Shared/_Admin.cshtml";
}

<div id="app">
    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">后台管理</strong> / <small>@ViewBag.Title</small></div>
    </div>

    <div class="am-g">
        <div class="am-g">
            <div class="am-u-sm-12 am-u-md-3">
                <div class="am-form-group">
                    <label>客户编号：</label>
                    <input type="text" class="am-input-sm" v-model="CustomNo" />
                </div>
            </div>
            <div class="am-u-sm-12 am-u-md-3">
                <div class="am-form-group">
                    <label>管家姓名：</label>
                    <input type="text" class="am-input-sm" v-model="AuntName" />
                </div>
            </div>


            <div class="am-u-sm-12 am-u-md-12">
                <button class="am-btn am-btn-primary" v-on:click="search">查询</button>


                <a href="../admin/export/RewardList" target="_blank" class="am-btn am-btn-primary">导出打赏记录Excel</a>
            </div>
            <div class="am-u-sm-12" style="overflow:auto;">
                <table class="am-table am-table-striped am-table-hover table-main">
                    <thead>
                        <tr>
                            <th>客户编号</th>
                            <th>客户姓名</th>
                            <th>管家姓名</th>
                            <th>打赏积分</th>
                            <th>打赏日期</th>
                            @*<th>结算状态</th>*@
                            @*<th>操作</th>*@
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var i in Model)
                        {
                            <tr>
                                <td>@i.CustomNo</td>
                                <td>@i.CreatedBy</td>
                                <td>@i.AuntName</td>
                                <td>@i.trTotolRate</td>
                                <td>@i.CreatedDate</td>
                                @*@if (i.RowStatus == 1)
                                    {
                                        <td>已结算</td>
                                    }
                                    @if (i.RowStatus == 2)
                                    {
                                        <td>未结算</td>
                                    }*@
                                @*<td>
                                        <div class="am-btn-toolbar" style="float:left;  margin-left:5px;">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a href="~/admin/order/detail?toSerialNo=@i.TRID" class="am-btn am-btn-primary am-btn-xs am-hide-sm-only"><span class="am-icon-edit"></span>结算</a>
                                            </div>
                                        </div>
                                    </td>*@

                            </tr>
                        }
                    </tbody>
                </table>
                <div class="am-cf">
                    &nbsp;&nbsp;共 {{totalCount}} 条记录, 每页 {{pageCount}} 条记录
                    <div class="am-fr">
                        <ul class="am-pagination">
                            <li style="width: 60px">
                                <input class="am-form-field" style="text-align:center" type="text" v-model="gotoPage" />
                            </li>
                            <li><a href="#" v-on:click="goto">GoTo &raquo;</a></li>
                            <li><a href="#" v-on:click="prev">&laquo; Prev</a></li>
                            <li><span>{{currentPage}}/{{totalPage}}</span></li>
                            <li><a href="#" v-on:click="next">Next &raquo;</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@section Scripts{
    <script>
        $('.admin-sidebar-reward').addClass('current');
        var model = new Vue({
            el: '#app',
            data: {
                totalCount: '@ViewBag.TotalCount',
                currentPage: '@ViewBag.CurrentPage',
                pageCount: '@ViewBag.PageCount',
                gotoPage: '@ViewBag.CurrentPage',
                totalPage: '@ViewBag.TotalPage',
                CustomNo: '',
                AuntName: ''
            },
            methods: {
                prev: function () {
                    var self = this;
                    if (self.currentPage <= 1)
                        return;

                    self.currentPage = parseInt(self.currentPage) - 1;
                    self.load();
                },
                next: function () {
                    var self = this;

                    if (self.currentPage >= self.totalPage)
                        return;

                    self.currentPage = parseInt(self.currentPage) + 1;

                    self.load();
                },
                goto: function () {
                    var self = this;
                    self.currentPage = self.gotoPage;
                    self.load();
                },
                search: function () {
                    var self = this;
                    self.currentPage = 1;
                    self.load();
                },
                load: function () {
                    var self = this;
                    window.location.href = "/admin/Reward/Index?page=" + self.currentPage + "&count=" + self.pageCount + "&CustomNo=" + self.CustomNo + "&AuntName=" + self.AuntName;
                },

            }
        });



        //$('.admin-sidebar-order').addClass('current');







    </script>
}
